@import "themes";

//遍历主题map
@mixin themeify {
  @each $theme-name, $theme-map in $themes {
    //!global 把局部变量强升为全局变量
    $theme-map: $theme-map !global;
    //判断html的data-theme的属性值  #{}是sass的插值表达式
    //& sass嵌套里的父容器标识   @content是混合器插槽，像vue的slot
    [data-theme="#{$theme-name}"] & {
      @content;
    }
  }
}

//声明一个根据Key获取颜色的function
@function themed($key) {
  @return map-get($theme-map, $key);
}

//获取背景颜色
@mixin background_color($color) {
  @include themeify {
    background-color: themed($color) !important;
  }
}

//获取字体颜色
@mixin font_color($color) {
  @include themeify {
    color: themed($color) !important;
  }
}

//获取边框颜色
@mixin border_color($color) {
  @include themeify {
    border-color: themed($color) !important;
  }
}

.chat-list {
  width: 100%;
  height: 1.3rem;
  display: flex;
  overflow: hidden;
  align-items: center;
  box-sizing: border-box;
  border-bottom: 0.02rem solid rgba(215, 212, 212, 0.3);

  .photo {
    width: 1.4rem;
    height: 1rem;

    img {
      object-fit: cover;
      width: 1rem;
      height: 1rem;
      display: block;
      margin: 0 auto;
      border-radius: 0.12rem;
    }
  }

  .content {
    flex: 5;
    box-sizing: border-box;

    div {
      display: flex;
      justify-content: space-between;
      align-items: center;

      .content_nickname {
        font-size: $font-size-30;
        font-weight: 550;
      }
      .content_validate{
        font-size: $font-size-32;
        color: #fff;
        span{
          border-radius: 0.1rem;
          height: 0.6rem;
          margin-right: 0.2rem;
          width: 1rem;
          background: #2ab3c0;
          display: flex;
          justify-content: center;
          align-items: center;
          &:last-child{
            background: #cc0c0c;
          }
        }
      }
      .content_time {
        margin-right: 0.2rem;
        color: rgb(209, 206, 206);
        font-size: $font-size-24;
      }
      .content_add{
        margin-right: 0.2rem;
        width: 1.8rem;
        height: 0.6rem;
        font-size: $font-size-32;
        color: #fff;
        display: flex;
        justify-content: center;
        align-items: center;
        border-radius: 0.1rem;
        background: #2ab3c0;
      }
    }

    .content_word {
      color: rgb(209, 206, 206);
      font-size: $font-size-28;
      display: block;
    }
  }
}
